<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" session="false" %><%@
	include file="/WEB-INF/jspf/import.jspf" %>
<!doctype HTML>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<meta id="twcClient" content="false" name="twcClient" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>车友会升级</title>
<meta name="keywords" content="汽车报价">
<meta name="description" content="太平洋汽车网为您提供最新报价信息，让您最快速查找到大众汽车最低价格。快速查询大众最新报价，就上太平洋汽车网。">
<meta name="Author" content="wangcaixia_gz none"/>
<link rel="stylesheet" type="text/css" href="http://js.3conline.com/wap/pcauto/2015/0409cyh_sx/up.css"></head>
<body>
<!--栏目计数器/文章计数器-->
         <jsp:include page="/template/wap/common/counter.jspf">
            <jsp:param name="channel" value="7378" />
        </jsp:include>
<div class="g-doc">

<div class="g-section">
   
	<div class="m-mod">
		<a href="${WAPROOT}/uplevel/goSelectUpgradeGift.do?clubId=${clubId}&from=${from}&${userSessionName}=${commonsessionId}" class="m-mod-th">升星礼包：</a>
		 <c:forEach var="maps" items="${giftMapList}">
		    <p class="m-mod-p"><span>${maps['name'] }</span><i>X</i><em>${maps['num'] }</em></p>
		   </c:forEach>
	</div>

	<div class="m-mod">
		<a href="${WAPROOT}/uplevel/goEditAddress.do?clubId=${clubId}&giftStr=${giftStr}&from=${from}&${userSessionName}=${commonsessionId}" class="m-mod-th">收件人信息：</a>
		<ul class="m-mod-info">
			<li>收件人：<em>${address.name}</em></li>
			<li>电话：<em>${address.phone}</em></li>
			<li>邮寄地址：<em>${address.address}</em></li>
		</ul>
	</div>

	<div class="select">
		<a href="javascript:void(0);"  onclick="return getPrize();" class="btn">立即升级</a>
	</div>

</div>

<div class="m-certify" id="Jcertify"></div>
<script src="http://js.3conline.com/wap/2013/common/js/zepto.min.js"></script>
<script src="http://js.3conline.com/wap/common/wap.lazy-min.js"></script>


<script>

var Jcertify = $('#Jcertify');
var giftStr = "${giftStr}";
function getPrize(){
    	$(".btn").addClass("disable").text("升级中...").removeAttr("onclick");
        $.ajax({
            url:"${WAPROOT}/uplevel/upgradeClubLevel.do",
            data:{
                levelId:${levelId},
                clubId:${clubId},
                giftStr:giftStr,
                ${userSessionName}:"${commonsessionId}",
                from:"${from}"
            },
            dataType:"json",
            type:"post",
            success: function (data){     
                if(data.statusCode ==0){
                	Jcertify.html("恭喜，成功升级"+${levelId}+"星车友会！").show();
            	    setTimeout(function(){Jcertify.hide()},2000);
        			setTimeout(function(){
        				  window.location.href="pcation://goback"; //提示升级成功后跳转回APP首页
        				},2000);
        	    	$(".btn").addClass("disable").text("升级完毕").removeAttr("onclick");
                }else{
                	Jcertify.html(data.message).show();
            	    setTimeout(function(){Jcertify.hide()},2000);
            	    $(".btn").removeClass("disable").text("立即升级").attr("onclick","return getPrize();");
                }
               
            },
            error:function(xmlHttpRequest, textStatus, errorThrown){
                var message = "网络错误,请联系管理员";
                if(xmlHttpRequest.status==503){
                    var json = eval("("+xmlHttpRequest.responseText+")");
                    message = (json.message == ""?"网络错误,请联系管理员":json.message);
                }
                Jcertify.html(message).show();
        	    setTimeout(function(){Jcertify.hide()},2000);
            	 $(".btn").removeClass("disable").text("立即升级").attr("onclick","return getPrize();");
            }
        });


}

</script>
</div>
</body>
</html>

